package utils

import (
	"fmt"
	//"github.com/google/uuid"
	"github.com/lithammer/shortuuid"
	"time"
)

//func DatetimePlusUuid() string {
//	sNowString := time.Now().Format("2006-01-02 15:04:05.000000000")
//	partYear := sNowString[0:4]
//	partMonth := sNowString[5:7]
//	partDay := sNowString[8:10]
//	partHour := sNowString[11:13]
//	partMinute := sNowString[14:16]
//	partSecond := sNowString[17:19]
//	//partMilliSecond := sNowString[20:23]
//
//	//part2 := sNowString[15:18]
//	//fmt.Printf("partYear is %s,partMonth is %s,partDay is %s,partHour is %s,partMinute is %s,partSecond is %s,msecond is %s,\n", partYear, partMonth, partDay, partHour, partMinute, partSecond, partMilliSecond)
//	sDate := fmt.Sprintf("%s%s%s", partYear, partMonth, partDay)
//	sTime := fmt.Sprintf("%s%s%s", partHour, partMinute, partSecond)
//	sUuid := uuid.New().String()
//
//	//dd59d281-f358-4494-8fab-b32b0d3eb671
//	sPart1Uuid := sUuid[0:8]
//	sPart2Uuid := sUuid[9:13]
//	sPart3Uuid := sUuid[14:18]
//	sPart4Uuid := sUuid[19:23]
//	sPart5Uuid := sUuid[24:36]
//
//	sResult := fmt.Sprintf("%s-%s-%s-%s%s%s-%s", sDate, sTime, sPart1Uuid, sPart2Uuid, sPart3Uuid, sPart4Uuid, sPart5Uuid)
//
//	return sResult
//}

func DatetimePlusShortUuid() string {
	sNowString := time.Now().Format("2006-01-02 15:04:05.000000000")
	partYear := sNowString[0:4]
	partMonth := sNowString[5:7]
	partDay := sNowString[8:10]
	partHour := sNowString[11:13]
	partMinute := sNowString[14:16]
	//partSecond := sNowString[17:19]
	//partMilliSecond := sNowString[20:23]
	sDate := fmt.Sprintf("%s%s%s", partYear, partMonth, partDay)
	sTime := fmt.Sprintf("%s%s", partHour, partMinute)
	sShortUuid := shortuuid.New()

	sResult := fmt.Sprintf("%s_%s_%s", sDate, sTime, sShortUuid)

	return sResult
}
